<?php
namespace Foam\Form;

use Zend\Form\Form;

class ProduitForm extends Form 
{
    public function __construct($name = null) 
    {
        parent::__construct('produit');
        $this->setAttribute('method', 'post');
        $this->setAttribute('enctype','multipart/form-data');
        
        $this->add(array(
            'name' => 'id_produit',
            'attributes' => array(
                'type'  => 'hidden',
            ),
        ));
        $this->add(array(
            'name' => 'code',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'Code',
            ),
        ));
        $this->add(array(
            'name' => 'libelle',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'Libelle',
            ),
        ));
        $this->add(array(
            'name' => 'description',
            'attributes' => array(
                'type'  => 'textarea',
            ),
            'options' => array(
                'label' => 'Description',
            ),
        ));
        $this->add(array(
            'name' => 'a_savoir',
            'attributes' => array(
                'type'  => 'textarea',
            ),
            'options' => array(
                'label' => 'A savoir',
            ),
        ));
        $this->add(array(
            'name' => 'image',
            'attributes' => array(
                'type'  => 'file',
            ),
            'options' => array(
                'label' => 'Image',
            ),
        ));
        $this->add(array(
            'name' => 'id_famille',
            'attributes' => array(
                'type'  => 'textarea',
            ),
            'options' => array(
                'label' => 'Famille',
            ),
        ));
        $this->add(array(
            'name' => 'save',
            'attributes' => array(
                'type'  => 'submit',
                'class' => 'button',
                'value' => 'Valider'
            ),
        )); 
    }
}